package br.ufpe.cin.imlm2.jbeat.soot.common.filters;

import soot.FastHierarchy;
import soot.Scene;
import soot.SootClass;

import br.ufpe.cin.imlm2.jbeat.soot.common.CommonExceptions;

/**
 * Retains exception classes (<code>SootClass</code> objects) which are not
 * subtypes of <code>java.lang.RuntimeException</code>.
 * 
 * @author Irineu
 * 
 */
public class CheckedExceptionFilter extends ThrowableFilter {

	@Override
	public boolean retains(SootClass t) {
		FastHierarchy hierarchy = Scene.v().getOrMakeFastHierarchy();
		// Verifying if t is an exception just for conformity.
		return super.retains(t)
				&& !hierarchy.isSubclass(t, CommonExceptions.getRUNTIME());
	}

}
